package com.slanmao.entity;


import org.apache.commons.lang.StringUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * area_serv
 * @author 
 */
public class AreaServ implements Serializable {
    /**
     * 主键
     */
    private Integer id;

    /**
     * 省
     */
    private String province;

    /**
     * 市
     */
    private String city;

    /**
     * 区
     */
    private String district;

    /**
     * 其他地区
     */
    private String other;

    /**
     * 公司名称
     */
    private String company;

    /**
     * 客服号码
     */
    private String custom;

    /**
     * 是否24小时
     */
    private Integer oncall;

    /**
     * 维修号码
     */
    private String repair;

    /**
     * 投诉号码
     */
    private String complain;

    /**
     * 官网
     */
    private String offcialsite;

    /**
     * 创建时间
     */
    private Date createtime;

    /**
     * 更新时间
     */
    private Date updatetime;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getOther() {
        return other;
    }

    public void setOther(String other) {
        this.other = other;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getCustom() {
        return custom;
    }

    public void setCustom(String custom) {
        this.custom = custom;
    }

    public Integer getOncall() {
        return oncall;
    }

    public void setOncall(Integer oncall) {
        this.oncall = oncall;
    }

    public String getRepair() {
        return repair;
    }

    public void setRepair(String repair) {
        this.repair = repair;
    }

    public String getComplain() {
        return complain;
    }

    public void setComplain(String complain) {
        this.complain = complain;
    }

    public String getOffcialsite() {
        return offcialsite;
    }

    public void setOffcialsite(String offcialsite) {
        this.offcialsite = offcialsite;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AreaServ other = (AreaServ) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getProvince() == null ? other.getProvince() == null : this.getProvince().equals(other.getProvince()))
            && (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
            && (this.getDistrict() == null ? other.getDistrict() == null : this.getDistrict().equals(other.getDistrict()))
            && (this.getOther() == null ? other.getOther() == null : this.getOther().equals(other.getOther()))
            && (this.getCompany() == null ? other.getCompany() == null : this.getCompany().equals(other.getCompany()))
            && (this.getCustom() == null ? other.getCustom() == null : this.getCustom().equals(other.getCustom()))
            && (this.getOncall() == null ? other.getOncall() == null : this.getOncall().equals(other.getOncall()))
            && (this.getRepair() == null ? other.getRepair() == null : this.getRepair().equals(other.getRepair()))
            && (this.getComplain() == null ? other.getComplain() == null : this.getComplain().equals(other.getComplain()))
            && (this.getOffcialsite() == null ? other.getOffcialsite() == null : this.getOffcialsite().equals(other.getOffcialsite()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProvince() == null) ? 0 : getProvince().hashCode());
        result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
        result = prime * result + ((getDistrict() == null) ? 0 : getDistrict().hashCode());
        result = prime * result + ((getOther() == null) ? 0 : getOther().hashCode());
        result = prime * result + ((getCompany() == null) ? 0 : getCompany().hashCode());
        result = prime * result + ((getCustom() == null) ? 0 : getCustom().hashCode());
        result = prime * result + ((getOncall() == null) ? 0 : getOncall().hashCode());
        result = prime * result + ((getRepair() == null) ? 0 : getRepair().hashCode());
        result = prime * result + ((getComplain() == null) ? 0 : getComplain().hashCode());
        result = prime * result + ((getOffcialsite() == null) ? 0 : getOffcialsite().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        if (!StringUtils.isEmpty(company)){
            sb.append("公司名称:"+company+"\r\n");
        }
        if (!StringUtils.isEmpty(custom)) {
            sb.append("客服电话:" + custom + "\r\n");
        }
        if (oncall!=null) {
            String msg = oncall==1?"是":"否";
            sb.append("是否24h服务:" + msg + "\r\n");
        }
        if (!StringUtils.isEmpty(repair)) {
            sb.append("维修电话:" + repair + "\r\n");
        }
        if (!StringUtils.isEmpty(complain)) {
            sb.append("投诉号码:" + complain + "\r\n");
        }
        if (!StringUtils.isEmpty(offcialsite)) {
            sb.append("官网:" + offcialsite + "\r\n");
        }
        return sb.toString();
    }
}